home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / vlistrem.cpp < prev    next >
C/C++ Source or Header  |  1991-04-27  |  477b  |  24 lines

  1. // VLISTREM.CPP - contains Vlist::Remove()
  2. //        removes a data item from the Vlist.
  3. //
  4.  
  5. #include "dblib.h"
  6.  
  7.     void  Vlist::Remove ( int k )
  8.             // remove a specfied item from list
  9.             {
  10.             void **vl =list;
  11.             int vn = n;
  12.             
  13.             if ( k >=0 && k < vn )    
  14.                 {
  15.                 free ( vl[k] );
  16.                 for ( register int i =k; i<vn; ++i )
  17.                     {
  18.                     vl[i] = vl[i+1];        // dont try to combine with ++i
  19.                     }
  20.                 }
  21.             return;        /* Vlist::remove()*/
  22.             }
  23. //    end of VLISTREM.CPP            
  24.